package com.yzr.common.thread.function;

import java.util.function.Predicate;

/**
 * 断定型接口：有一个输入参数，返回值是布尔类型
 */
public class PredicateDemo {
    public static void main(String[] args) {
        // 判断字符串是否为空
        /*Predicate<String> stringPredicate = new Predicate<String>() {
            @Override
            public boolean test(String s) {
                return s.isEmpty();
            }
        };*/
        Predicate<String> predicate = String::isEmpty;
        System.out.println(predicate.test("yzr"));
    }
}
